/*
 * Copyright (c) 2006-2023, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2023-03-14     RT-Thread    first version
 */

#include <rtthread.h>
#include <rtdevice.h>
#include <drv_common.h>
#define DBG_TAG "main"
#define DBG_LVL DBG_LOG
#include <rtdbg.h>

#define VCC_DEV GET_PIN(B,9)
#define BEEP_PIN GET_PIN(B,0)
#define LED     GET_PIN(C,13)

//外设供电引脚
static int vcc_init(void)
{
    rt_pin_mode(VCC_DEV,PIN_MODE_OUTPUT);
    rt_pin_write(VCC_DEV, 1);
    rt_pin_mode(BEEP_PIN, PIN_MODE_OUTPUT);
    rt_pin_write(BEEP_PIN, 1);
    return RT_EOK;
}
INIT_BOARD_EXPORT(vcc_init);





int main(void)
{
    int count = 1;
    rt_pin_mode(LED, PIN_MODE_OUTPUT);

    while (count++)
    {
        //LOG_D("Hello RT-Thread!");

            rt_pin_write(LED,count%3);
        rt_thread_mdelay(1000);
    }

    return RT_EOK;
}
